package cn.cinz.service;

import cn.cinz.dao.BlogMapper;
import cn.cinz.pojo.Blog;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class BlogServiceImpl implements BlogService {

    BlogMapper blogMapper;

    @Autowired
    public void setBlogMapper(BlogMapper blogMapper) {
        this.blogMapper = blogMapper;
    }


    @Override
    public int addBlog(Blog blog) {
        return blogMapper.addBlog(blog);
    }

    @Override
    public List<Blog> queryBlogList(String userName) {
        return blogMapper.queryBlogList(userName);
    }

    /**
     * 修改一篇博客
     * @param blog 博客对象
     * @return
     */
    @Override
    public int updateBlog(Blog blog) {
        return blogMapper.updateBlog(blog);
    }

    @Override
    public int deleteBlog(String blogId) {
        return blogMapper.deleteBlog(blogId);
    }

    @Override
    public List<Blog> queryBlogStatusList(String blogStatus,String blogTitle) {
        return blogMapper.queryBlogStatusList(blogStatus,blogTitle);
    }

//    @Override
//    public List<Blog> queryBlogTitleList(String blogTitle) {
//        return blogMapper.queryBlogTitleList(blogTitle);
//    }
}
